import {mutaitionTypes} from './constant';

const mixin = {
    computed: {
        count:function(){
            return this.$store.getters.count
        },
        sum:function(){
            return this.$store.getters.sum
        },
        shoplist(){
            console.log(this.$store.state.shoplist);
            return this.$store.state.shoplist
        }
    },
    methods: {
        plus(item){
            this.$store.commit(mutaitionTypes.COUNTPLUS,item)
        },
        remove(id){
            this.$store.commit(mutaitionTypes.REMOVE,id)
        },
        jian(item){
            this.$store.commit(mutaitionTypes.COUNTMINUS,item)
        },
        // changeNum(){
        //     this.$store.commit(mutaitionTypes.CHANGENUM1)
        // }
    },
}
export default mixin;